import { createApp } from 'vue'
import App from './App'
import router from './router'
import store from './store'
import lazyUse from './core/lazy-use' // 按需引入配置
import Cookie from 'js-cookie'
import { authKey } from '@/config'
import '@/core/request' // 请求配置
import './permissions' // 权限配置
import './utils/rem' // html font-size
import './assets/styles/index.less' // 全局css

/* socket引用*/
import socket from './components/socket-sdk/index.js'

if (process.env.NODE_ENV === 'development') {
  Cookie.set(
    authKey,
    'QmVhcmVyIGV5SmhiR2NpT2lKSVV6VXhNaUo5LmV5SjFjMlZ5WDJ0bGVTSTZJbWQzWDNSdmEyVnVYM1Z6WlhKZmEyVjVNVFV4TmpJeE56STVNalUyT1Raak16VmhZaTFpTmpKbUxUUTVOalF0T1Rsa05DMWpZMk0yTXpjME1EQTRZekV4T0RjeE16VXlNekF3TXpBMU1UWXlNalFpTENKelpYTnphVzl1WDJsa0lqb2lOamsyWXpNMVlXSXRZall5WmkwME9UWTBMVGs1WkRRdFkyTmpOak0zTkRBd09HTXhJaXdpZFhObGNtNWhiV1VpT2lJeE5URTJNakUzTWpreU5TSjkud1NwQW5OS0NkVVhaN0hIWVRDVDNtTWlhbmlsb1VtSEl6Wkt5MEpwaFNaWEdESXFNQ3lhMnZlUlN4SjlWQzZyOTZpTWVRTDFIQ0hWVDRtdnJ2OWw0d2c='
  )
}

const app = createApp(App)

app.use(socket)
console.log(app.config.globalProperties, 'app 入口mian')
app.use(store).use(router)

app.use(lazyUse)
app.mount('#app')
